<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改物料')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-material-edit" th:object="${material}">
			<input id="id" name="id" type="hidden" th:field="*{id}"/>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label is-required">物料编码：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="code" id="code" th:field="*{code}" disabled>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label is-required">物料名称：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="name" id="name" th:field="*{name}"  required>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">单位：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="unit" id="unit" th:field="*{unit}" >
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">颜色：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="color" id="color" th:field="*{color}" >
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">启用批次管理：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="batch" id="batch" th:field="*{batch}" >
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">安全库存总数量：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="safeStock" id="safeStock" th:field="*{safeStock}" >
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">最大库存总量：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="maxStock" id="maxStock" th:field="*{maxStock}" >
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">重量：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="weight" id="weight" th:field="*{weight}" >
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">关联图纸：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="associatedDrawingId" id="associatedDrawingId" th:field="*{associatedDrawingId}" >
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">质检标记：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="quality" id="quality" th:field="*{quality}" >
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label is-required">物料状态：</label>
						<div class="col-sm-8">
							<select name="status" class="form-control" th:with="type=${@dict.getType('sys_normal_disable')}">
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
							</select>
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group" id="hidePost">
						<label class="col-sm-3 control-label is-required">物料类型：</label>
						<div class="col-sm-8">
							<select id="type" name="type" class="form-control" th:with="type=${@dict.getType('material_type')}">
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-3 control-label">审批状态：</label>
						<div class="col-sm-8">
							<input class="form-control" type="text" name="auditStatus" id="auditStatus" th:field="*{auditStatus}" >
						</div>
					</div>
				</div>
			</div>
			<h4 class="form-header h4">其他信息</h4>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-xs-3 control-label">备注：</label>
						<div class="col-xs-8">
							<textarea id="remark" name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
			</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
			</button>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "system/material";

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-material-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
